#!/usr/bin/env python
# Wrapper to draw ast arg1 = dbname arg2 = tname
import sys
sys.path.append('/opt/ssp_plugin/plib')
import libsql as sql
from ast2graph import AST


dbname = sys.argv[1]
tbname = "`%s`"%(sys.argv[2])
instance = sql.SQL(dbname, tbname)
G = AST(sys.argv[2])
G.get(instance)
G.work()
G.draw(name = 'ast.png')
instance.free()
